<%@ page isELIgnored="false" language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ include file="/views/common/header.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<c:set var="_path" value="${pageContext.request.contextPath}"></c:set>
<sec:authentication property="principal" var="authentication"/>
<html>
  <head>
    <title>电子一卡通管理系统</title>
	<script type="text/javascript">
		var selfPath= '${_path}';
		jQuery(function($){
			InitLeftMenu(${authentication.menu});
			updateNoticeNum();
		});
		function listMad(){
			showWindow({
				title : '系统公告列表',
				width:600,
				height:400,
				href:'${_path}/mad/listMad'
			});
		}
		function updateNoticeNum(){
			$.ajax({
				url:'${_path}/mad/countCurrMad',
				complete:function(a,b){
					if(a.status == 200){
						$('#wel_notice_num').html(eval("(" + a.responseText + ")").madCount)
					}
					setTimeout('updateNoticeNum()',30*1000);
				}
			});
		}
	</script>	
  </head>
  <!-- easyui-layout 可分上下左右中五部分，中间的是必须的，支持href，这样就可以不用iframe了 -->
  <body class="easyui-layout" id="mainBody">
		<!-- 上 -->
		<div region="north" split="false" style="overflow:hidden;height:103px" border="false">
			<table width="100%" style="background-color: #40a9ed;padding:0px;margin:0px;background-image: url('${_path}/img/topbg.png');background-repeat:no-repeat" height="100%" border="0" cellpadding="0" cellspacing="0" class="header_body">
  <tr>
    <td height="95px" valign="top" ><table width="430" border="0" cellpadding="0" cellspacing="0" class="header_body_button">
      <tr>
        <td colspan="5" background="img/softz_02.jpg" class="header_body_user">
        	<div style="float:left;width:370px;overflow: hidden;height:20px;text-indent: 70px;margin-top:5px;">
	       		用户名: <span style="color: blue;"><sec:authentication property="name"/></span> 
	       		角色: <span style="color: blue;" title="${authentication.roleName}">${authentication.roleName}</span>
       		</div>
        	<div style="float:right;width:50px;padding:0px;margin:0px;">
	        	<a title="公告"  href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-notice" onclick="listMad()" style="padding:0px;margin:0px;">
	        		<span id="wel_notice_num" style="color:red;font-size: 14px;padding:0px;margin:0px;"></span>
	        	</a>
        	</div>
        </td>
      </tr>
      <tr>
        <td align="center">
        	<a style="cursor: pointer;" onclick="_toIndex()">
	        	<img src="img/png-0048.png" width="32" height="32"><br>
	          	&nbsp;&nbsp;&nbsp;&nbsp;首页
	        </a>
	    </td>
        <td align="center">
        	<a style="cursor: pointer;" onclick="_changePassword()" target="main">
        		<img src="img/png-0054.png" width="32" height="32"><br>
          		修改密码
          	</a>
        </td>
        <td align="center">
        	<a style="cursor: pointer;" onclick="_reLogin()" target="_parent">
        		<img src="img/png-0521.png" width="32" height="32"><br>
          		重新登录
          	</a>
        </td>
        <td align="center">
        	<a style="cursor: pointer;" onclick="_logout()" >
        		<img src="img/png-0652.png" width="32" height="32"><br>
         		 退出系统
         	</a>
        </td>
        <td align="center">
        	<a style="cursor: pointer;" onclick="doPrint();" target="main">
        		<img src="img/png-0529.png" width="32" height="32"><br>
          		报表统计
          	</a>
        </td>
      </tr>
    </table></td>
    <tr>
			<td  colspan="5" height="8" class="bg"></td>
		</tr>
  </tr>
  <tr>
    <td height="8" class="bg"></td>
  </tr>
</table>
		</div>
		
		<!-- 左-->
		<div region="west" class="menudiv" split="true" title="系统菜单" style="width:200px;overflow:hidden;">
			<div id="menuDiv" class="easyui-accordion" data-options="fit:true,border:false">
			</div>
		</div>
		
		<!-- 中 -->
		<div region="center" id="centerId" class="maindiv" title="所在位置: 首页" style="overflow-x:hidden;padding: 0px;" href="<%=basePath %>aaa/index" ></div>
  </body>
</html>
